import iconList from '@/config/iconList'

export const option = {
  lazy: true,
  tip: false,
  simplePage: true,
  searchShow: true,
  searchMenuSpan: 6,
  dialogType: 'drawer',
  dialogWidth: '70%',
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 150,
  dialogClickModal: false,
  align: 'center',
  column: [
    {
      label: '菜单名称',
      prop: 'name',
      search: true,
      align: 'left',
      headerAlign: 'center',
      minWidth: 150,
      rules: [
        {
          required: true,
          message: '请输入菜单名称',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '路由地址',
      prop: 'path',
      minWidth: 150,
      rules: [
        {
          required: true,
          message: '请输入路由地址',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '上级菜单',
      prop: 'parentId',
      type: 'tree',
      dicData: [],
      hide: true,
      addDisabled: false,
      props: {
        label: 'title'
      },
      rules: [
        {
          required: false,
          message: '请选择上级菜单',
          trigger: 'click'
        }
      ]
    },
    {
      label: '菜单图标',
      prop: 'source',
      type: 'icon',
      slot: true,
      iconList: iconList,
      minWidth: 100,
      rules: [
        {
          required: false,
          message: '请输入菜单图标',
          trigger: 'click'
        }
      ]
    },
    {
      label: '菜单编号',
      prop: 'code',
      search: true,
      minWidth: 100,
      rules: [
        {
          required: true,
          message: '请输入菜单编号',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单类型',
      prop: 'category',
      type: 'radio',
      dicData: [
        {
          label: '菜单',
          value: 1
        },
        {
          label: '按钮',
          value: 2
        }
      ],
      hide: true,
      rules: [
        {
          required: true,
          message: '请选择菜单类型',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单别名',
      prop: 'alias',
      search: true,
      minWidth: 100,
      rules: [
        {
          required: true,
          message: '请输入菜单别名',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '新窗口',
      prop: 'isOpen',
      type: 'radio',
      disabled: false,
      minWidth: 80,
      dicData: [
        {
          label: '否',
          value: 1
        },
        {
          label: '是',
          value: 2
        }
      ],
      value: 1,
      rules: [
        {
          required: true,
          message: '请选择新窗口打开',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单排序',
      prop: 'sort',
      type: 'number',
      row: true,
      span: 24,
      minWidth: 80,
      rules: [
        {
          required: true,
          message: '请输入菜单排序',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '菜单备注',
      prop: 'remark',
      type: 'textarea',
      span: 24,
      minRows: 2,
      hide: true
    }
  ]
}
